import java.lang.reflect.Method;

/**
 * @author Jerry
 * @Description
 * @date 2016-10-06
 */
public class ClassUtil {
    public static void printMessage(Object obj) {
        Class a = obj.getClass();
        System.out.println("该类的名字是：" + a.getName());
        Method[] methods = a.getMethods();
        for (Method method : methods) {
            Class returnType = method.getReturnType();
            System.out.println("方法返回值类型为：" + returnType.getName());
            System.out.print("方法名为：" + method.getName() + "(");
            Class[] parameter = method.getParameterTypes();
          for(Class ccc : parameter){
              System.out.print(ccc.getSimpleName()+",");
          }
            System.out.print(")");
        }
    }
}
